two trains travelling in same direction problem